package com.bao.work.jin.message;

import com.bao.work.jin.service.GoodsService;
import com.bao.work.jin.service.impl.GoodsServiceImpl;

import java.io.IOException;

/**
 * @author baoye
 * @date 2024-08-02/19:34
 */
public class SystemMessage {
    public static final GoodsService GOODS_SERVICE = new GoodsServiceImpl();

    public static void main(String[] args) throws IOException {
        while (true) {
            System.out.println("******欢迎光临京东商城******");
            System.out.println("1.添加商品");
            System.out.println("2.查看所有商品");
            System.out.println("3.查看自动编号商品");
            System.out.println("4.添加商品到购物车");
            System.out.println("5.查看购物车");
            System.out.println("6.退出");
            System.out.println("**************************");
            switch (GoodsService.INPUT.nextInt()) {
                case 1:
                    GOODS_SERVICE.addGoods();
                    break;
                case 2:
                    GOODS_SERVICE.selectGoods();
                    break;
                case 3:
                    GOODS_SERVICE.selectGoodsById();
                    break;
                case 4:
                    GOODS_SERVICE.insertGoodsToCart();
                    break;
                case 5:
                    GOODS_SERVICE.selectCart();
                    break;
                default:
                    System.out.println("退出");
                    System.exit(0);

            }
        }
    }
}
